import Vue from 'vue';
import Vuex from 'vuex';

import user from './modules/user';
import lsfh from './modules/lsfh';
import getters from './getters';

Vue.use(Vuex);

const store = new Vuex.Store({
  modules: {
    user,
    lsfh,
  },
  getters,
});
export const useVuexStore = () => {
  const vm = getCurrentInstance();
  if (!vm) throw new Error('must be called in setup');
  return vm.proxy.$store;
};

export default store;
